import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:yi_shop/utils/colors.dart';
import 'package:yi_shop/utils/styles.dart';

class SearchGoodsController extends GetxController {}

class SearchGoodsView extends GetView<SearchGoodsController> {
  const SearchGoodsView({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView(
      children: [
        Container(
          color: Colors.white,
          padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 10),
          margin: const EdgeInsets.only(top: 15),
          child: Row(
            children: [
              ClipRRect(
                borderRadius: BorderRadius.circular(5.r),
                child: CachedNetworkImage(
                  imageUrl:
                      'https://img.alicdn.com/imgextra/i1/771054577/O1CN01cpBo2b1jgJkZWAe84_!!771054577-0-alimamacc.jpg_360x360xzq75.jpg',
                  width: 112,
                  height: 85,
                  fit: BoxFit.fill,
                ),
              ),
              Expanded(
                  child: Padding(
                padding: const EdgeInsets.only(left: 10, right: 20),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '官方旗舰店!华为HMS服务5G智能手机!512G内存,6.5寸大屏',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, lineHeight: 1.3.h),
                      ),
                    ),
                    Container(
                      alignment: Alignment.centerLeft,
                      margin: const EdgeInsets.only(top: 15),
                      child: Text(
                        '￥1999',
                        style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                      ),
                    )
                  ],
                ),
              ))
            ],
          ),
        ),
        Container(
          color: Colors.white,
          padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 10),
          margin: const EdgeInsets.only(top: 15),
          child: Row(
            children: [
              ClipRRect(
                borderRadius: BorderRadius.circular(5.r),
                child: CachedNetworkImage(
                  imageUrl:
                      'https://img.alicdn.com/imgextra/i1/771054577/O1CN01cpBo2b1jgJkZWAe84_!!771054577-0-alimamacc.jpg_360x360xzq75.jpg',
                  width: 112,
                  height: 85,
                  fit: BoxFit.fill,
                ),
              ),
              Expanded(
                  child: Padding(
                padding: const EdgeInsets.only(left: 10, right: 20),
                child: Column(
                  children: [
                    Container(
                      alignment: Alignment.centerLeft,
                      child: Text(
                        '官方旗舰店!华为HMS服务5G智能手机!512G内存,6.5寸大屏',
                        style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color3333, lineHeight: 1.3.h),
                      ),
                    ),
                    Container(
                      alignment: Alignment.centerLeft,
                      margin: const EdgeInsets.only(top: 15),
                      child: Text(
                        '￥1999',
                        style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                      ),
                    )
                  ],
                ),
              ))
            ],
          ),
        ),
        for (var i = 0; i < 10; i++)
          Container(
            color: Colors.white,
            padding: const EdgeInsets.symmetric(vertical: 15, horizontal: 10),
            margin: const EdgeInsets.only(top: 15),
            child: Row(
              children: [
                ClipRRect(
                  borderRadius: BorderRadius.circular(5.r),
                  child: CachedNetworkImage(
                    imageUrl:
                        'https://img.alicdn.com/imgextra/i1/771054577/O1CN01cpBo2b1jgJkZWAe84_!!771054577-0-alimamacc.jpg_360x360xzq75.jpg',
                    width: 112,
                    height: 85,
                    fit: BoxFit.fill,
                  ),
                ),
                Expanded(
                    child: Padding(
                  padding: const EdgeInsets.only(left: 10, right: 20),
                  child: Column(
                    children: [
                      Container(
                        alignment: Alignment.centerLeft,
                        child: Text(
                          '官方旗舰店!华为HMS服务5G智能手机!512G内存,6.5寸大屏',
                          style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color3333, lineHeight: 1.3.h),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        margin: const EdgeInsets.only(top: 15),
                        child: Text(
                          '￥1999',
                          style: StylesUtils.customTextStyle(color: ColorsUtils.colorF048),
                        ),
                      )
                    ],
                  ),
                ))
              ],
            ),
          ),
      ],
    );
  }
}
